package com.heshuo.util;

import org.apache.struts2.ServletActionContext;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.opensymphony.xwork2.ActionSupport;

public class MyBeanUtil extends ActionSupport{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public static Object getBean(String name) {
		WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(ServletActionContext.getServletContext());  
		return ctx.getBean(name);
	}

}
